package com.ccb.sc.common.modules.live.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @version 1.0
 * @date 2022-07-30 21:48
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum LiveStreamingGoodsStatus implements IEnum<Integer> {

    /**
     * 状态 0未生效 1未开播 2已开播
     */
    NOT_ACTIVE(0, "未生效"),

    NOT_START_LIVE(1, "未开播"),

    LIVE(2, "已开播"),

    ;
    private int value;
    private String desc;

    LiveStreamingGoodsStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static LiveStreamingGoodsStatus getByValue(int value) {
        for (LiveStreamingGoodsStatus liveStreamingOrderStatus : LiveStreamingGoodsStatus.values()) {
            if (liveStreamingOrderStatus.getValue() == value) {
                return liveStreamingOrderStatus;
            }
        }
        return null;
    }
}
